<include file="Public:header" />
<script type="text/javascript" src="/Public/Js/step-jquery-dc/step-jquery-dc.js"></script>
<link rel="stylesheet" href="/Public/Js/step-jquery-dc/css/step-dc-style1.css" />

<form name="myform" id="myform" method="POST" action="__ACTION__">
	<input name="content[call_id]" type="hidden" value="{$info['id']}">
  <input name="course" id="course" type="hidden" value="{$info['course']|default='1'}">
  <fieldset>
    <legend>基本信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
      	<tr>
          <th width="80">联系人：</th>
          <td>{$info['name']}</td>
        </tr>
        <tr>
          <th>电话：</th>
          <td>{$info['phone']}</td>
        </tr>
        <tr>
          <th>区域：</th>
          <td>{$info.province|getAreaInfo='name'}-{$info.city|getAreaInfo='name'}-{$info.area|getAreaInfo='name'}</td>
        </tr>
        <tr>
          <th>性别：</th>
           <td>{$info['sexName']}</td>
        </tr>
      </tbody>
    </table>
  </fieldset>
  <fieldset>
    <legend>跟进内容</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
      	<tr>
          <th width="80">进度：</th>
          <td><div class="step_context test" style="height:100px;"></div></td>
        </tr>
        <tr>
          <th>时间：</th>
          <td>
            <input id="talktime" type="text" class="input-text Wdate" size="30" name="content[talktime]" value="<php>echo date('Y-m-d H:i:s');</php>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width:160px;" />

            <span style="margin-left:10px;">状态：</span>
            <input name="dial_status" id="dial_status_1" type="radio" value="1" checked="checked" >
            <label for="dial_status_1">重点跟进</label>&nbsp;&nbsp;
            <input name="dial_status" id="dial_status_2" type="radio" value="2"  >
            <label for="dial_status_2">发现问题</label>
            <input name="dial_status" id="dial_status_3" type="radio" value="3"  >
            <label for="dial_status_3">无反应</label>
            <input name="dial_status" id="dial_status_4" type="radio" value="4"  >
            <label for="dial_status_4">放弃跟进</label>

          </td>
        </tr>
        <tr class="last" >
          <th>内容：</th>
          <td><textarea name="content[content]" id="editor" cols="4" rows="5" style="width:650px;"></textarea></td>
        </tr>

      </tbody>
    </table>
  </fieldset>
  <input type="submit" value="提交" class="dialog" id="dosubmit">
</form>
</body>
</html>
<script type="text/javascript" src="/Public/Js/ueditor/ueditor.config.js"></script>	<!--ueditor编辑器-->
<script type="text/javascript" src="/Public/Js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
$(function(){
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});
	function checkForm(){
		var content = $("#editor").val();
		if(content==''){
			msg('电话内容不能为空！',0);
			return false;
		}
		return true;
	}

	var origin = $.artDialog.open.origin;

    function complete(data){
    	msg(data.info,data.status);
		if(data.status) setTimeout(function(){origin.location.reload();},1000);
    }

})
</script>
<script>
$(document).ready(function(){

});
</script>
<script type="text/javascript">
UE.getEditor('editor',{
	//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
	//toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold','test']],
	//focus时自动清空初始化时的内容
	autoClearinitialContent:false,
	//关闭字数统计
	wordCount:false,
	//关闭elementPath
	elementPathEnabled:false,
	//默认的编辑区域高度
	initialFrameHeight:250
	//更多其他参数，请参考ueditor.config.js中的配置项
})
</script>

<script type="text/javascript">
//所有步骤的数据
var stepListJson = {$stepListJson};
var allNum = stepListJson.length;

//当前进行到第几步
var currentStep={$info['process']|default='1'};
//new一个工具类
var StepTool = new Step_Tool_dc("test","mycall");
//使用工具对页面绘制相关流程步骤图形显示
StepTool.drawStep(currentStep,stepListJson);
//回调函数
function mycall(restult){
//  alert("mycall"+result.value+":"+result.text);
  if(result.value<currentStep){
    alert('客户进度只能前进不能后退！');
    return false;
  }
  StepTool.drawStep(result.value,stepListJson);
  $("#course").val(result.value);
}
</script>